#include <stdio.h>

void abc(double *p1, double *p2,double *p3);

int main(void)
{
    double x, y, z;

    printf("Enter three numbers (q to quit): ");
    while (scanf("%lf %lf %lf", &x, &y, &z) == 3)
    {
        abc(&x, &y, &z);
        printf("The modified values are %.3f %.3f %.3f", x, y, z);
        printf("Next three values (q to quit): ");
    }
    printf("Bye!\n");



    return 0;
}

void abc(double *p1, double *p2, double *p3)
{
        double temp;
        if(*p1 <= *p2 && *p1 >= *p3)
            {
                temp = *p3;
                *p3 = *p2;
                *p2 = *p1;
                *p1 = temp;
            }
        if(*p1 >= *p2 && *p2 >= *p3)
        {
            temp = *p3;
            *p3 = *p1;
            *p1 = temp;
        }
        if(*p1 >= *p2 && *p1 <= *p3)
        {
            temp = *p2;
            *p2 = *p1;
            *p1 = temp;
        }
        if(*p1 >= *p3 && *p3 >= *p2)
        {
            temp = *p2;
            *p2 = *p3;
            *p3 = *p1;
            *p1 = temp;
        }
        if(*p1 <= *p3 && *p3 <= *p2)
        {
              temp = *p3;
              *p3 = *p2;
              *p2 = temp;
        }

}